<!--
 * @Author: ke.xue
 * @Date: 2023-11-23 14:42:27
 * @LastEditors: ke.xue
 * @LastEditTime: 2023-11-23 15:37:42
 * @FilePath: \html_demo\featch.html
 * @Description: 文件描述
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>请求</title>
  <style>
    .content {
      display: none;
    }
  </style>
</head>
<body>
  <div class="page">
    <h1 class="title" id="title">标题</h1>
    <div class="content" id="mainContent">内容</div>
  </div>
  <script>
    const searchParams = new URLSearchParams(document.location.search)
    try {
      async function getData() {
        const resData = await fetch('https://h5-test.jiangxi-isuzu.cn/cms-h5/api-cms-gateway/scrm-qwagg-service/api/v1/content/material/lib/getDetailById', {
          method: 'post',
          body: searchParams
        })
        console.log(resData);
      }
      getData()
    } catch (err) {
      console.log(err);
    }
    setTimeout(() => {
      document.getElementById('title').textContent = '这里是标题'
      document.getElementById('mainContent').innerHTML = '<p>这里是内容</p><p>这里是内容3</p><h2>这里是内容4</h2><p>这里是内容5</p>'
      document.getElementById('mainContent').style.display = 'block'
    }, 2000)
  </script>
</body>
</html>